import request from '@/utils/request'



// 
export function createOrder(data) {
  return request({
    url: '/api/order',
    method: 'post',
    data
  })
}


//根据用户id获取订单
export function orderListByUserId(data) {
  return request({
    url: `/api/order?pageNum=${data.pageNum}&pageSize=${data.pageSize}&orderStatus=${data.selectStatus}`,
    method: 'get',
  })
}


//根据订单id删除订单
export function delOrder(orderId) {
  return request({
    url: `/api/order/${orderId}`,
    method: 'delete',
  })
}


//根据订单id修改订单状态
export function updateOrder(orderId) {
  return request({
    url: `/api/order/${orderId}`,
    method: 'put',
  })
}

//根据订单id获取单个订单
export function getOrder(orderId) {
  return request({
    url: `/api/order/get?orderId=${orderId}`,
    method: 'get',
  })
}


//支付
export function wxpay(id) {
  return request({
    url: `/api/weixinpay?orderId=`+id,
    method: 'get',
  })
}




